home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _74956C6B49534909B1C120A35C5A403B < prev    next >
Encoding:
Text File  |  2004-01-06  |  1018 b   |  35 lines

  1. // ===============================================================
  2. // Vertex Program: 
  3. // Description: 
  4. // Last Update: 14/08/2003
  5. // Coder: Andrey Honich
  6. // ===============================================================
  7.  
  8.       #include "../CGVPMacro.csi"
  9.  
  10.  
  11.       VertAttributes { POSITION_3 TEXCOORD0_2 TANG_3X3 }
  12.       MainInput { VIEWPROJ_MATRIX, LIGHT_MATRIX, LIGHT_POS, ATTEN }
  13.       DeclarationsScript
  14.       {
  15.         IN_T0_C0_TANG
  16.         OUT_T0_T1_T2_T3_C0_C1
  17.       }
  18.       PositionScript = PosCommon
  19.       CoreScript
  20.       {
  21.         OUT.Tex0.xy = IN.TexCoord0.xy;
  22.         OUT.Tex1.xy = IN.TexCoord0.xy;
  23.         OUT.Tex3 = mul(LightMatrix, vPos);
  24.  
  25.         TANG_MATR
  26.  
  27.         // store normalized light vector
  28.         float3 lightVec = LightPos.xyz - vPos.xyz;
  29.         float fiSqDist = rsqrt(dot(lightVec, lightVec));
  30.         
  31.         OUT.Color1.xyz = PROC_ATTENVERT;
  32.         OUT.Tex2.xyz = mul(objToTangentSpace, lightVec);          
  33.         OUT.Color = IN.Color;
  34.       }
  35.